package cn.com.guage.huawei;

import java.util.Arrays;
import java.util.Iterator;
import java.util.Scanner;
import java.util.TreeSet;

public class 明明的随机数 {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		sortAndSequencing3(in);
	}

	public static void sortAndSequencing3(Scanner sc) {
		while (sc.hasNext()) {
			int count = sc.nextInt();
			TreeSet set = new TreeSet();
			for (int i = 0; i < count; i++) {
				set.add(sc.nextInt());
			}
			Iterator it = set.iterator();
		
			while (it.hasNext()) {
				System.out.println(it.next());
			}

		}
	}

	public static void sortAndSeqencing1(Scanner in) {
		while (in.hasNext()) {
			int count = in.nextInt(); // 随机数总数
			int[] data = new int[count];
			for (int i = 0; i < count; i++) // 读入生成的随机数
				data[i] = in.nextInt();

			Arrays.sort(data); // 使用库函数排序
			System.out.println(data[0]); // 打印排序后的第一个数（必不重复）
			for (int i = 1; i < count; i++) { // 打印其他数字，需与前面数字比较，不重复才能打印
				if (data[i] != data[i - 1])
					System.out.println(data[i]);
			}
		}
	}

	public static void sortAndSeqencing2(Scanner sc) {
		while (sc.hasNext()) {
			// 获取个数
			int num = sc.nextInt();
			// 创建TreeSet进行去重排序
			TreeSet set = new TreeSet();
			// 输入
			for (int i = 0; i < num; i++) {
				set.add(sc.nextInt());
			}

			// 输出
			Iterator iterator = set.iterator();
			while (iterator.hasNext()) {
				System.out.println(iterator.next());
			}
		}
	}
}
